Skip to content

Conversation

HoZHel
Copy link
Contributor

@HoZHel HoZHel commented Aug 12, 2025

Provide PM support, specifically suspend-to-ram.

Add PM support to the Bluetooth HCI driver.

Optimize power consumption for the Nucleo-WB09KE board.

Provide radio timer driver for STM32WB0x SoCs to be used as the system timer when Bluetooth and/or PM are enabled.

Set the appropriate value for SYS_CLOCK_HW_CYCLES_PER_SEC and
SYS_CLOCK_TICKS_PER_SEC when radio timer is used as the system timer.

Enable UART wake-up line in STM32 driver.

Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for some
STM32WB0 drivers due to the misunderstanding of its definition.

Update west to point to the recent changes for hal_stm32.

Supplementary PR #303.

@mathieuchopstm, thank you for your support in PM.

Comment on lines 11 to 13
config SYS_CLOCK_HW_CYCLES_PER_SEC
default 409600
depends on STM32_RADIO_TIMER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get this from a dts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a software timer and there is no crystal running at this frequency that's why it is set in Kconfig. What do you think now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardware timer with software configurability? That can be represented in dts, it's going through a hardware block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me explain more:
SYS_CLOCK_HW_CYCLES_PER_SEC=409600 is the system time unit (STU). One STU is equal to 625/256 μs (about 2.4414 μs). It is independent to the hardware oscillator variation. Every timeout event is expressed in STU. Only before programming the real counter, the time expressed in STU is converted to the hardware timer counting unit internally from the radio timer driver.
Do you still think that it should be defined in a DTS file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so then the radio timer driver is wrong? This value should be the hardware cycles per second, as the name implies, there shouldn't be some software translation in a radio driver that changes this into the actual value that the hardware uses, it should be using the hardware value directly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use the LSE (low-speed external 32.768 kHz), the SYS_CLOCK_HW_CYCLES_PER_SEC can be calculated and is well known. However, when using the LSI (low-speed internal), this value varies because the clock frequency is unknown and differs between devices within a certain range. In our Bluetooth protocol implementation, it is easier to use the STU, which is fixed and independent of both LSI and LSE. We manage internally this value according to the different HW configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, but the value is known, it can be assigned to a node in dts then retrieved, it is hardware

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


/* Construct net_buf from event data */
buf = get_rx(buffer_out);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the NULL check should be 1st, and it should result in a panic or reset or something if it's not excepted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of "the NULL check should be 1st," Can you explain more?
For the second part, you mean to put something like __ASSERT_NO_MSG(buf);?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I meant is

	if (buf == NULL) {
                LOG_ERR("Buf is null");
                Panic/return error if pointer should never be Null
        }
	/* Handle the received HCI data */
	LOG_DBG("New event %p len %u type %u", buf, buf->len, buf->data[0]);
	hci->recv(dev, buf);

Copy link
Contributor Author

@HoZHel HoZHel Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, the null check is implemented in the else. Since the function is void, it's not returning any error, and also the situation is not critical to panic. So, LOG_ERR is enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the null check is implemented in the else

That's not a good coding pattern in my opinion.

@HoZHel HoZHel force-pushed the PM_with_radio_timer branch from 7e53340 to be88807 Compare August 13, 2025 08:05
Copy link

github-actions bot commented Aug 13, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_stm32 zephyrproject-rtos/hal_stm32@3a4b521 zephyrproject-rtos/hal_stm32#303 zephyrproject-rtos/hal_stm32#303/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_stm32 DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Aug 13, 2025
@mathieuchopstm mathieuchopstm self-requested a review August 19, 2025 11:23
@HoZHel HoZHel requested a review from erwango August 22, 2025 09:05
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick skimming

Comment on lines 13 to 39
static int board_pupd_init(void)
{
LL_PWR_EnableGPIOPullUp(LL_PWR_GPIO_A,
LL_PWR_GPIO_BIT_0|
LL_PWR_GPIO_BIT_1|
LL_PWR_GPIO_BIT_2|
LL_PWR_GPIO_BIT_3);

LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_A,
LL_PWR_GPIO_BIT_8|
LL_PWR_GPIO_BIT_9|
LL_PWR_GPIO_BIT_10|
LL_PWR_GPIO_BIT_11);

LL_PWR_EnableGPIOPullDown(LL_PWR_GPIO_B,
LL_PWR_GPIO_BIT_0|
LL_PWR_GPIO_BIT_3|
LL_PWR_GPIO_BIT_6|
LL_PWR_GPIO_BIT_7);

LL_PWR_EnableGPIOPullUp(LL_PWR_GPIO_B,
LL_PWR_GPIO_BIT_1|
LL_PWR_GPIO_BIT_2|
LL_PWR_GPIO_BIT_4|
LL_PWR_GPIO_BIT_5|
LL_PWR_GPIO_BIT_14|
LL_PWR_GPIO_BIT_15);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a way to use fts and gpio hog to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, gpio hog is used to automatically set a GPIO pin at boot, but in this file these pull-up/pull-down configs are related to PWR register and they will be applied when the SoC enters suspend-to-ram state. In other words, they are not used in active state.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we do keep PWRC_CR1.APC at default value and configure GPIO pull-up/pull-down via PWR on WB0 series:

static inline void ll_gpio_set_pin_pull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
{
#if defined(CONFIG_SOC_SERIES_STM32WB0X)
/* On STM32WB0, the PWRC PU/PD control registers should be used instead
* of the GPIO controller registers, so we cannot use LL_GPIO_SetPinPull.
*/
const uint32_t gpio = (GPIOx == GPIOA) ? LL_PWR_GPIO_A : LL_PWR_GPIO_B;
if (Pull == LL_GPIO_PULL_UP) {
LL_PWR_EnableGPIOPullUp(gpio, Pin);
LL_PWR_DisableGPIOPullDown(gpio, Pin);
} else if (Pull == LL_GPIO_PULL_DOWN) {
LL_PWR_EnableGPIOPullDown(gpio, Pin);
LL_PWR_DisableGPIOPullUp(gpio, Pin);
} else if (Pull == LL_GPIO_PULL_NO) {
LL_PWR_DisableGPIOPullUp(gpio, Pin);
LL_PWR_DisableGPIOPullDown(gpio, Pin);
}
#else
LL_GPIO_SetPinPull(GPIOx, Pin, Pull);
#endif /* CONFIG_SOC_SERIES_STM32WB0X */
}

so this configuration would be applied all the time, as far as I understand. (and most importantly: lost if the application changes the pins' configuration!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. So, I should implement these pull-up/pull-down configs in the board's DTS file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. You should use a GPIO hog as suggested by @erwango.
See example here:

&gpioe {
status = "okay";
/* Enable 2.7V Analog LDO */
ldo-enable-gpios {
gpio-hog;
gpios = <15 GPIO_ACTIVE_HIGH>;
output-high;
};
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I noticed, it sets the pin state at boot time, and it's not related to pull-up/pull-down configs. It doesn't support bias-pull-up and bias-pull-down properties.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried using gpios = <xx GPIO_PULL_UP> / gpios = <xx GPIO_PULL_DOWN>? From my understanding of the hog driver, it should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 26 to 28
imply PM_DEVICE if PM
imply PM_S2RAM
imply PM_S2RAM_CUSTOM_MARKING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of imply make it possible that activation if not done if dependency is not met, w/o any error reported.
When using select an error will be generated if dependencies of selected symbol is not met and hence expected configuration cannot be met.
Is that done on purpose ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean why select ... if ... is not used instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using select ... if PM for all should work.
I may have used imply to avoid repeating the if PM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 100 to 101
#define STM32_HCLK_FREQUENCY DT_PROP(DT_NODELABEL(rcc), clock_frequency)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to put that definition in a header somewhere - or in fact, it may already be! - instead of re-defining it in every driver.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about defining it in include/zephyr/dt-bindings/clock/stm32_common_clocks.h

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This header is for DT bindings only, it should just contain (un)packing macros for DT->driver exchanges.

I think placing the definition in <soc.h> (soc/st/stm32/stm32wb0x/soc.h) would be acceptable. The header might also be already by drivers too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, it's only for WB0x. What about other STM32 products?

Copy link
Contributor

@mathieuchopstm mathieuchopstm Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it could go in here? I was suggesting <soc.h> because I was a bit worried WB0 that including this file on WB0 would blow up, but now I realize it's actually used and my fears are unjustified 😅

Name should be changed if we place it in the general file, maybe to something like STM32_MAIN_SYSTEM_FREQ (because it corresponds to AXI frequency on some SoCs).

Note that the definition will be unused on all other STM32 until we clean-up the SYS_CLOCK_HW_CYCLES_PER_SEC mess, which will be done in another PR, hence why having something WB0-specific for now is fine (IMO)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I implemented in soc/st/stm32/stm32wb0x/soc.h

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that soc.h wasn't a good idea since rtc_ll_stm32.c and entropy_stm32.c are not WB0-only drivers. So, I'll define it in stm32_clock_control.h as you suggested above.

Comment on lines 563 to 564
PM_DEVICE_DT_INST_DEFINE(0, ble_pm_action);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this to the HCI_DEVICE_INIT() macro:

Suggested change
PM_DEVICE_DT_INST_DEFINE(0, ble_pm_action);

+

#define HCI_DEVICE_INIT(inst) \
+       PM_DEVICE_DT_INST_DEFINE(inst, ble_pm_action);
	static struct hci_data hci_data_##inst = { \
	}; \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

#define HCI_DEVICE_INIT(inst) \
static struct hci_data hci_data_##inst = { \
}; \
DEVICE_DT_INST_DEFINE(inst, NULL, NULL, &hci_data_##inst, NULL, \
DEVICE_DT_INST_DEFINE(inst, NULL, PM_DEVICE_DT_INST_GET(0), &hci_data_##inst, NULL, \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DEVICE_DT_INST_DEFINE(inst, NULL, PM_DEVICE_DT_INST_GET(0), &hci_data_##inst, NULL, \
DEVICE_DT_INST_DEFINE(inst, NULL, PM_DEVICE_DT_INST_GET(inst), &hci_data_##inst, NULL, \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.



BUILD_ASSERT(DT_NODE_HAS_STATUS(DT_NODELABEL(clk_lsi), disabled),
"At the moment, LSI is not supported");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
"At the moment, LSI is not supported");
"LSI not supported yet");

+ we should check if the slow-clock property on rcc is clk_lsi instead... but that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 26 to 28
imply PM_DEVICE if PM
imply PM_S2RAM
imply PM_S2RAM_CUSTOM_MARKING
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using select ... if PM for all should work.
I may have used imply to avoid repeating the if PM.

@@ -8,6 +8,18 @@ if SOC_SERIES_STM32WB0X
config NUM_IRQS
default 32

config SYS_CLOCK_HW_CYCLES_PER_SEC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think putting these directives in a if STM32_RADIO_TIMER block would yield the same result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/* Wait to be sure that the Radio Timer is active */
while (LL_RADIO_TIMER_GetAbsoluteTime(WAKEUP) < 0x10) {
}
HAL_RADIO_TIMER_Init(&VTIMER_InitStruct);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
HAL_RADIO_TIMER_Init(&VTIMER_InitStruct);
/* Note: Device IRQs are enabled by this function */
HAL_RADIO_TIMER_Init(&VTIMER_InitStruct);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment on lines 42 to 82
/*
* Check for Deepstop exit on wakeup event:
* - RCC_CSR is zero
* - PWRC.EXTSRR has bit DEEPSTOPF set
* (Redundant => unchecked)
* - Either PWRC_SR1 or PWRC_SR3 is non-zero
*
* Note that we don't have to clear any register since
* they are automatically updated on reset/wake-up.
*
* IMPLEMENTATIONS DETAILS:
* r1 must not be modified and the stack must not be
* used by this function as of writing, due to the
* current implementation of arch_pm_s2ram_resume.
* As such, we can only use r0, r2 and r3 here.
*
* N.B.: r12 is also volatile for the ARM ABI, but it
* cannot be used for most operations on ARMv6-M due
* to 16-bit Thumb limitations, so we might as well
* avoid using it entirely.
*/
ldr r0, =RCC_CSR
ldr r2, [r0]
cmp r2, #0
bne not_deepstop_wakeup

ldr r0, =PWR_BASE
ldr r2, [r0, #PWR_SR1]
ldr r3, [r0, #PWR_SR3]
orrs r2, r2, r3
beq not_deepstop_wakeup

/**
* All conditions met: this is a wakeup from Deepstop.
*/
movs r0, #1
bx lr

not_deepstop_wakeup:
movs r0, #0
bx lr
Copy link
Contributor

@mathieuchopstm mathieuchopstm Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
* Check for Deepstop exit on wakeup event:
* - RCC_CSR is zero
* - PWRC.EXTSRR has bit DEEPSTOPF set
* (Redundant => unchecked)
* - Either PWRC_SR1 or PWRC_SR3 is non-zero
*
* Note that we don't have to clear any register since
* they are automatically updated on reset/wake-up.
*
* IMPLEMENTATIONS DETAILS:
* r1 must not be modified and the stack must not be
* used by this function as of writing, due to the
* current implementation of arch_pm_s2ram_resume.
* As such, we can only use r0, r2 and r3 here.
*
* N.B.: r12 is also volatile for the ARM ABI, but it
* cannot be used for most operations on ARMv6-M due
* to 16-bit Thumb limitations, so we might as well
* avoid using it entirely.
*/
ldr r0, =RCC_CSR
ldr r2, [r0]
cmp r2, #0
bne not_deepstop_wakeup
ldr r0, =PWR_BASE
ldr r2, [r0, #PWR_SR1]
ldr r3, [r0, #PWR_SR3]
orrs r2, r2, r3
beq not_deepstop_wakeup
/**
* All conditions met: this is a wakeup from Deepstop.
*/
movs r0, #1
bx lr
not_deepstop_wakeup:
movs r0, #0
bx lr
/*
* Check for Deepstop exit on wakeup event:
* - RCC_CSR is zero
* - PWRC.EXTSRR has bit DEEPSTOPF set
* (optional; RCC_CSR check suffices)
* - Either PWRC_SR1 or PWRC_SR3 is non-zero
*
* Note that we don't have to clear any register since
* they are automatically updated on reset/wake-up.
*/
ldr r0, =RCC_CSR
ldr r0, [r0]
cmp r0, #0
bne not_deepstop_wakeup
ldr r0, =PWR_BASE
ldr r1, [r0, #PWR_SR1]
ldr r0, [r0, #PWR_SR3]
orrs r0, r0, r1
beq not_deepstop_wakeup
/* All conditions met: this is a wakeup from Deepstop. */
movs r0, #1
bx lr
not_deepstop_wakeup:
movs r0, #0
bx lr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@HoZHel HoZHel force-pushed the PM_with_radio_timer branch 3 times, most recently from 1836ad9 to 6e06ff5 Compare September 1, 2025 16:12
@HoZHel HoZHel force-pushed the PM_with_radio_timer branch from 6e06ff5 to 52716ce Compare September 3, 2025 10:35
@HoZHel HoZHel marked this pull request as ready for review September 3, 2025 13:01
@zephyrbot zephyrbot added area: UART Universal Asynchronous Receiver-Transmitter area: ADC Analog-to-Digital Converter (ADC) area: Crypto / RNG area: Timer Timer area: RTC Real Time Clock platform: STM32 ST Micro STM32 area: Bluetooth HCI Bluetooth HCI Driver area: Clock Control area: Bluetooth labels Sep 3, 2025

#define MULT64_THR_FREQ (806)
#define TIMER_MAX_VALUE (0xFFFFFFFFU)
#define TIMER_WRAPPING_MARGIN (4096)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove the outer parentheses in the 3 lines above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should commit "drivers: Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC" be backportred in v4.1 and v4.2 branches?

Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for STM32WB0
drivers due to the misunderstanding of its definition.

Signed-off-by: Ali Hozhabri <[email protected]>
@HoZHel HoZHel force-pushed the PM_with_radio_timer branch from aaf6e85 to c8e9805 Compare September 8, 2025 10:10
@HoZHel
Copy link
Contributor Author

HoZHel commented Sep 8, 2025

Should commit "drivers: Fix the improper use of CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC" be backportred in v4.1 and v4.2 branches?

No.

Comment on lines 1 to 2
/* stm32wb0_radio_timer.c - STM32WB0x Radio Timer */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can drop these 2 lines, for consistency in the Zephyr source tree.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return;
}

#if defined(CONFIG_TICKLESS_KERNEL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If applicable, it would be better to have the below instruction conditioned with:

	if (IS_ENABLED(CONFIG_TICKLESS_KERNEL)) {
	}

instead of #if ... #endif.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

select HAS_STM32CUBE
select SOC_EARLY_INIT_HOOK
# WB0x has a ROM bootloader executed at reset,
# which makes the following option required
select INIT_ARCH_HW_AT_BOOT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this empty line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Provide radio timer driver for STM32WB0x SoCs.

Signed-off-by: Ali Hozhabri <[email protected]>
Use radio timer as the system timer when Bluetooth is used.

Modify CMakeLists.txt to compile radio timer driver when
STM32WB0_RADIO_TIMER is enabled.

Remove the common parts from hci_stm32wb0.c that are present
in the radio timer driver.

Set and retrieve the appropriate value for SYS_CLOCK_TICKS_PER_SEC and
SYS_CLOCK_HW_CYCLES_PER_SEC respectively.

Define radio_timer node and its properties.

Enable radio_timer node in nucleo_wb0x boards.

Signed-off-by: Ali Hozhabri <[email protected]>
Provide PM support, specifically suspend-to-ram, for STM32WB0x.

Enable STM32_RADIO_TIMER Kconfig parameter when PM is set.

Signed-off-by: Ali Hozhabri <[email protected]>
Enable UART wake-up line in STM32 driver.

Signed-off-by: Ali Hozhabri <[email protected]>
Add PM support to the STM32WB0x Bluetooth HCI driver.

Implement PM event register to wake up the device for its BLE events.

Signed-off-by: Ali Hozhabri <[email protected]>
Optimize power consumption for the Nucleo-WB09KE board by
implementing correct pull-up/pull-down configurations when the device
enters lower power states.

Disable the SMPS with floating output in suspend-to-ram (deepstop)
power state.

Signed-off-by: Ali Hozhabri <[email protected]>
Update west.yml to point to the recent changes for hal_stm32.

Signed-off-by: Ali Hozhabri <[email protected]>
@HoZHel HoZHel force-pushed the PM_with_radio_timer branch from c8e9805 to 0b323aa Compare September 12, 2025 08:12
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Bluetooth HCI Bluetooth HCI Driver area: Bluetooth area: Clock Control area: Crypto / RNG area: RTC Real Time Clock area: Timer Timer area: UART Universal Asynchronous Receiver-Transmitter DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_stm32 platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants